﻿#ifndef PST_LINECHARTCOORDINATESETTINGDATA_H
#define PST_LINECHARTCOORDINATESETTINGDATA_H

#include "DataModelPost.h"
class QDomElement;
class QDomDocument;
class QDomNodeList;
namespace pst
{

    /// @brief 2D图形显示设置
    class LineChartCoordinateSettingData : public QObject
    {
        Q_OBJECT

    public:
        Q_INVOKABLE LineChartCoordinateSettingData(QObject* parent = nullptr);
        ~LineChartCoordinateSettingData();

        //void copyData(const LineChartCoordinateSettingData* data);

        void setXAxisDisplay(Style2D_Axis* data);
        Style2D_Axis* getXAxisDisplay() const;

        void setXAxisRange(Style2D_AxisRange* data);
        Style2D_AxisRange* getXAxisRange() const;

        void setYAxisDisplay(Style2D_Axis* data);
        Style2D_Axis* getYAxisDisplay() const;

        void setYAxisRange(Style2D_AxisRange* data);
        Style2D_AxisRange* getYAxisRange() const;

        void setGrid(Style2D_GridLine* data);
        Style2D_GridLine* getGrid() const;

        void setTitle(Style2D_Title* data);
        Style2D_Title* getTitle() const;

        void setLegend(Style2D_Legend* data);
        Style2D_Legend* getLegend() const;

        //void setDataProperty(Style2D_DataProperty* data);
        //Style2D_DataProperty* getDataProperty() const;

        /// @brief 文件写出至工程文件
        QDomElement& writeToProjectFile(QDomDocument* doc, QDomElement* element, bool isdiso = false);
        /// @brief 从工程文件读入数据
        void readFromProjectFile(QDomElement* element, bool isdiso = false);

    private:
        Style2D_Axis* m_xAxisDisplay;         // X轴显示
        Style2D_AxisRange* m_xAxisRange;      // X轴范围
        Style2D_Axis* m_yAxisDisplay;         // Y轴显示
        Style2D_AxisRange* m_yAxisRange;      // Y轴范围
        Style2D_GridLine* m_grid;             // 网格线
        Style2D_Title* m_title;               // 标题
        Style2D_Legend* m_legend;             // 图例
        //Style2D_DataProperty* m_dataProperty; // 数据属性

    public:
        int indexOfGraph{-1};
    };
} // namespace pst
#endif // PST_DATAGRAPH2DSETTINGS_H
